﻿<!-- #include file="mymin.asp" -->
<card title="会员账户管理"><p>
<%

dim id,rs
id=getN("id",1)
If getData("a")<>"1" Then
	set rs=Server.CreateObject("ADODB.Recordset")
	rs.open"select name,password from 74hu_user where ID="&id,myconn,1,1
	If Not rs.eof	Then
		w "用户名<input name=""name"&time_r&""" value="""&nowml(rs("name"))&""" maxlength=""16""/><br/>"&_
			"密码<input name=""pass"&time_r&""" value="""&nowml(rs("password"))&""" maxlength=""16""/><br/>"&_
			"<anchor>保存修改<go href=""password.asp?sid="&sid&"&amp;a=1&amp;id="&id&""" accept-charset=""utf-8"">"&_
			"<postfield name=""name"" value=""$(name"&time_r&")""/><postfield name=""pass"" value=""$(pass"&time_r&")""/></go></anchor><br/>"
	Else
		w "没有这个会员！<br/>"
	End If
	rs.close
	set rs=nothing
Else
	Dim name,pass,lenname,lenpass
	name=getData("name")
	pass=getData("pass")
	lenname=len(name)
	lenpass=len(pass)
	If name="" Or pass="" Then
		w "用户名密码不能为空!<br/><a href=""password.asp?sid="&sid&"&amp;id="&id&""">返回修改</a><br/>"
	Elseif IsNumeric(left(name,1)) Then
		w "用户名不能以数字开头!<br/><a href=""password.asp?sid="&sid&"&amp;id="&id&""">返回修改</a><br/>"
	Elseif lenname<2 or lenpass<2 or lenname>16 or lenpass>16 Then
		w "用户名密码长度为2-16位!<br/><a href=""password.asp?sid="&sid&"&amp;id="&id&""">返回修改</a><br/>"
	Else
		Dim Count
		Count=myconn.Execute("select count(id) from 74hu_user where name='"&name&"' and id<>"&id&"")(0)
		If Count<>0 Then
			w "用户名已存在!<br/><a href=""password.asp?sid="&sid&"&amp;id="&id&""">返回修改</a><br/>"
		Else
			myconn.execute("update 74hu_user set name='"&name&"',[password]='"&pass&"' where id="&id)
			w "修改成功!<br/><a href=""detail.asp?sid="&sid&"&amp;id="&id&""">返回管理</a><br/>"
		End If
	End If
End If
w "----------<br/><a href=""member.asp?sid="&sid&"&amp;"">[会员总管]</a>"

call bbsLast
%>